The present invention relates to a method and apparatus of processing data, in particular for compressing (and/or encrypting) data.
Currently, information held on a computer is stored as ones and zeros (bits) which are grouped into sets of eight bits which are referred to as bytes. Two bytes are referred to as a word (16 bits), and four bytes are referred to as a double word (32 bits) or can be used as the mathematical storage referred to as a 32-bit integer (int32 or Long). An integer which has a bit length of 32 can hold a value between −2147483648 and +2147483647; or by removing the sign and making it an unsigned 32-bit integer (UInt32), the longest number that can be stored is 4294967295 (232−1).
It is desirable to represent information using the smallest number of bits possible in order to reduce the space required for storage and to minimise the resources required for signalling information from one entity to another. In computer science and information theory, data compression (also referred to as source coding) involves encoding information using fewer bits than the original representation. Furthermore, it is important that sensitive data, represented using the American Standard Code Information Interchange (ASCII) standard or by other means, is protected, for example by preventing access to this data by unauthorised persons or machines. Therefore, methods of encrypting and decrypting data form an integral part of information technology.
Compression can be either lossy or lossless. Lossless compression reduces bits by identifying and eliminating statistical redundancy. No information is lost in lossless compression. In contrast, lossy compression reduces the total number of bits by identifying marginally important information and removing it.
Once data has been compressed, it must subsequently decompressed in order for it to be used. Both compression and decompression require computer processing. Therefore, data compression/decompression must find a compromise between the level of compression achieved and the computer processing required for compression and decompression. For example, a compression scheme for video may require expensive hardware for the video to be decompressed fast enough for it to be watched as it is being decompressed, and the option to decompress the video in full before watching it may be inconvenient and may require additional storage.